<template>
	<view>
		<view style="padding: 40rpx;border-bottom: 1px solid #000;" v-for="item in data" :key="data"
			@click="open(item)">
			{{item.title}}
		</view>
		<uni-popup ref="inputDialog" type="dialog">
			<uni-popup-dialog ref="inputClose" mode="input" title="输入内容" v-model="curTitle" placeholder="请输入内容"
				@confirm="dialogInputConfirm"></uni-popup-dialog>
		</uni-popup>
		<view style="margin-top: 24rpx;">
			问题复现步骤：点击文章列表的标题，弹框回显当前点击的文章标题。无法正常回显，并且控制台报错-<text style="color: red;">ReferenceError: setVal is not defined</text>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	const data = [
		{
			id: 1,
			title: '文章1'
		}, {
			id: 2,
			title: '文章2'
		}
	]
	const curTitle = ref('')
	const inputDialog = ref(null)
	const open = (item : { id : number, title : string }) => {
		curTitle.value = item.title
		inputDialog.value.open()
	}

	const dialogInputConfirm = () => {
		inputDialog.value.close()
	}
</script>

<style>
</style>